function view_onMouseMove() {
    var x = event.x - manager.containerDisplayArea.x;
    var y = event.y - manager.containerDisplayArea.y;
    if (manager.page==0) { parameters.scrollOn = todo; }
    else if (manager.page==1) {
        if (y >= doing.area.y && y <= doing.area.y+doing.area.height) {
            parameters.scrollOn = doing;
        }
        else {
            parameters.scrollOn = impeded;
        }
    }
    else if (manager.page==2) {
        parameters.scrollOn = done;
    }
    else {
        parameters.scrollOn = null;
    }
}



function scrollUp() {
    var scrollOn = parameters.scrollOn;
    if (scrollOn) {
        if (scrollOn.viewPost>0) {
            scrollOn.viewPost--;
            updateGui( user.getProject() );
        }
    }
   
}

function scrollDown() {
    var scrollOn = parameters.scrollOn;
    if (scrollOn) {
        var posts;
        var view;
        var scroll;
        if (scrollOn.containerType==TODO) {
            posts = user.getProject().todo.getPosts();
        }
        else if (scrollOn.containerType==DOING) {
            posts = user.getProject().doing.getPosts();
        }
        else if (scrollOn.containerType==IMPEDED) {
            posts = user.getProject().impeded.getPosts();
        }
        else if (scrollOn.containerType==DONE) {
            posts = user.getProject().done.getPosts();
        }
        view = scrollOn.posts;
        scroll = scrollOn.viewPost;
        
        if ( posts[ scroll + scrollOn.displayedPosts ] != null ) {
            scrollOn.viewPost++;
            updateGui( user.getProject() );
        }
    }

}

function resetScroll() {
    todo.viewPost = 0;
    doing.viewPost = 0;
    impeded.viewPost = 0;
    done.viewPost = 0;
    
}

function view_onMouseWheel() {
    if (event.wheelDelta>0)
        scrollUp();
    else if (event.wheelDelta<0)
        scrollDown();
}